Repository navigation
Conversation
Retrieval resolves knowledge bases by name through `kb_names` in the configuration, but renaming a knowledge base only updated the database record. Every subsequent lookup missed the renamed knowledge base and `check_all_kb()` treated it as empty, silently skipping retrieval until the user re-selected it in the dashboard. Propagate the new name to every configuration profile that still references the old one so retrieval keeps working after a rename.
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. Renaming a knowledge base now rewrites and saves its name in every configuration profile that selected it. If that mapping is wrong, reverting the code will not restore the saved profile values; they are bounded and can be corrected by updating the configuration.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / 动机
Renaming a knowledge base breaks retrieval:
kb_namesin the configuration still holds the old name, soget_kb_by_name()misses it andcheck_all_kb()skips retrieval without any error. Re-selecting the knowledge base is the only workaround.重命名知识库后检索失效:配置里的
kb_names仍是旧名称,get_kb_by_name()匹配不到,check_all_kb()直接跳过检索且不报错,必须重新选择知识库才能恢复。Modifications / 改动点
knowledge_base_service.py: on rename, propagate the new name tokb_namesin every config profile (deduplicated, UUID entries untouched).重命名时把新名称同步到每份配置的
kb_names(去重,UUID 条目保持原样)。回归测试:改名后检索仍然可用。
Verification / 验证
English
colain the config, retrieval works.cola-v2on the knowledge base page.cola, so retrieval returns nothing until it is re-selected.中文
cola,检索正常。cola-v2。cola,检索失效,重新选择后才恢复。colacola-v2colaTest Results / 测试结果
Checklist / 检查清单